package com.cola.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Grup:com.cola.springmvc.controller
 * @Auther:cola
 * @Data:2021/4/24-2021-04-0:21
 * @version:1.0
 */
@Controller
@RequestMapping("/user")
public class UserController {

    //url的get形式的匹配
    @RequestMapping("list")
    public String list(@RequestParam(value = "currentpage",defaultValue = "1",required = false) Integer currentpage,
                       @RequestParam(value = "pagesize",defaultValue = "10",required = false) Integer pagesize){
        System.out.println("currentpage:"+currentpage);
        System.out.println("pagesize:"+pagesize);
        return "user/list";
    }
    @RequestMapping("get/{id}")
    public String get(@PathVariable(value = "id")Integer id){
        System.out.println("id"+id);
        return "user/edit";
    }
}
